package com.example.note;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class MyAdapter extends ArrayAdapter<Notes> {
	public MyAdapter(Context context, ArrayList<Notes> notes) {
		super(context, 0, notes);
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		// get data
		Notes note = getItem(position);
		if (convertView == null) {
			convertView = LayoutInflater.from(getContext()).inflate(
					R.layout.item_notes, parent, false);
		}
		TextView tv1 = (TextView) convertView.findViewById(R.id.tvTitle);
		TextView tv2 = (TextView) convertView.findViewById(R.id.tvTime);

		tv1.setText(note.getTitle());
		tv2.setText(note.getUpdateAt());
		return convertView;
	}

}
